# def isPalindrome(self, x):
#   if x<0 or x%10==0 and x!=0:
#     return False 
#   l,r=0,len(str(x))-1
#   while(l<=r):
#     if str(x)[l]!=str(x)[r]:return False
#     else:
#       l+=1
#       r-=1
#   else:
#     return True
def isPalindrome(self, x):
  if x<0 or x%10==0 and x!=0:
    return False 
  rev=0
  while(rev<x):
    rev=rev*10+x%10
    x//=10
  return x==rev or x==rev//10